/*
 * File Created: 2019-11-28 19:53:00
 * Author: 余保林 (yubaolin6@outlook.com)
 * Desc: 权益管理相关接口
 * Last Modified: 2019-11-30 16:20:30
 * Modified By: 余保林 (yubaolin6@outlook.com>)
 */

import request from '@/utils/request'

export function equityAll() {
  return request.get('/platform/privileges')
}

/**
 * 分页查询 权益
 * @param {*} params
 */
export function equityQuery(params) {
  return request.get(`/platform/privileges/query`, { params })
}

/**
 * 新增权益
 * @param {*} data
 */
export function equityAdd(data) {
  return request.post('/platform/privileges', data)
}

/**
 * 权益详情
 * @param {*} data
 */
export function equityDetail(id) {
  return request.get(`/platform/privileges/${id}`)
}

/**
 * 编辑权益
 * @param {*} data
 */
export function equityEdit(data) {
  return request.patch(`/platform/privileges/${data.id}`, data)
}

/**
 * 暂停权益
 * @param {*} data
 */
export function equityPause(id) {
  return request.patch(`/platform/privileges/${id}/pause`)
}

/**
 * 回复权益
 * @param {*} data
 */
export function equityRecover(id) {
  return request.patch(`/platform/privileges/${id}/recover`)
}

/**
 * 查询所有在使用的权益
 * @param {*} params
 */
export function equityQueryNormal() {
  return request.get(`/platform/privileges/enable`)
}
